<template>
	<view>
		<view class="page-body" v-show="isfensi === 'no'">
				<view class="bg-white p20">
					<image :src="baseUrl+img_url" @click="app.showImg(baseUrl+img_url)" style="width: 100%;" mode="widthFix"></image>
				</view>
			<bottomShare :imgFile="baseUrl+img_url" :url="baseUrl+img_url" :share_url="share_url"></bottomShare>
		</view>
		<view class="page-body" v-show="isfensi === 'yes'"> 
			<view class="fensi">粉丝身份不能分享，请升级成为会员！</view> 
		</view>
	</view>
</template>

<script>
	import bottomShare from '@/components/bottomShare';
	export default {
		components: {
			bottomShare
		},
		data() {
			return {
				is_wxmp:0, 
				img_url:'',
				baseUrl:this.config.baseUrl,
				share_url:'',
				isfensi:''
			}
		},
		onLoad(options) {
			this.getImg();
			
		},
		onShow: function() {},
		computed: {},
		onReady() {
		},
		methods: {
			getImg(){
				//#ifdef MP-WEIXIN
					this.is_wxmp = 1;
				//#endif
				this.$u.post('member/api.users/getShareImg',{isnew:1,is_wxmp:this.is_wxmp}).then(res => {
					this.img_url = res.data.img;
					this.share_url = res.data.share_url;
					this.isfensi = res.data.isfensi;
					if(this.isfensi == 'yes'){
						/*
						uni.showToast({ //提示
							title: '粉丝身份不能分享,请升级成为会员!',
							//将值设置为 success 或者直接不用写icon这个参数
							icon: 'success',
							//显示持续时间为 2秒
							duration: 5000
						});
						*/ 
					   uni.showModal({
					           title: '温馨提示',
					           content: '粉丝身份不能分享,请升级成为会员!',
					           success: function(res) {
								   if (res.confirm) {
									   // 执行确认后的操作
								   } 
								   else {
									   // 执行取消后的操作
								   }
							   }
					   })
						
						//alert("粉丝身份不能分享，请升级成为会员！");
					}
				});
				
			}
		}
	}
</script>

<style lang="scss">
	.fensi{
		text-align: center;
	}
</style>
